package minidb.parse.exps;

import java.io.Serializable;


abstract public class Operand implements Serializable
{
	abstract public Object ToValue();
	abstract public String Print();
	abstract public String Print_Base();
	abstract public Operand DupOperand();
	
	public static Operand FillOperand(Object val)
	{	
		if(val==null)
			return new OperandNull();
		else if(Integer.class.isInstance(val))
			return new OperandInt((Integer)val);
		else if(String.class.isInstance(val))
			return new OperandString((String)val);
		else if(Double.class.isInstance(val))
			return new OperandDouble((Double)val);
		else
			throw new RuntimeException("FillOperand():unexpected object type");
	}
	
}
